<script setup>
    // import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
    // #ifdef H5
    (function() {
        if (typeof WeixinJSBridge === 'object' && typeof WeixinJSBridge.invoke === 'function') {
            handleFontSize()
        } else {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', handleFontSize, false)
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', handleFontSize)
                document.attachEvent('onWeixinJSBridgeReady', handleFontSize)
            }
        }

        function handleFontSize() {
            // 设置网页字体为默认大小
            WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize': 0 })
            // 重写设置网页字体大小的事件
            WeixinJSBridge.on('menu:setfont', function() {
                WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize': 0 })
            })
        }
    })()
    // #endif
    // 引入常用方法类
    import * as tools from './common/sju.tools.js'
    onLaunch(() => {
        console.log('App Launch')
    })
    onShow(() => {
        console.log('App Show')
        // #ifdef MP 
        tools.VersionUpdate() //小程序模式下检测小程序更新
        // #endif
    })
    onHide(() => {
        console.log('App Hide')
    })
</script>

<style lang="scss">
    @import "@/static/iconfont.css";

    /*每个页面公共css */
    page {
        background-color: $bg-color;
        font-size: $font-size-base;
        color: $text-color;
        padding-bottom: 120rpx;
    }

    /* #ifdef H5 */
    body {
        /* IOS禁止微信调整字体大小 */
        -webkit-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        -moz-text-size-adjust: 100% !important;
    }

    /* #endif */
</style>